package com.huli.utils;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class TimeUtils {
    public static long getMinuteSub(Date date1, Date date2) {
        long dif =date2.getTime() - date1.getTime() ;
        long min= dif/1000/60;
        return min;
    }

    public static Date addMinute(Date date,int minute) {
        GregorianCalendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        calendar.add(calendar.DATE, minute);
        Date date1 = calendar.getTime();
        return date1;
    }

    public static Date now(){
        return new Date();
    }
}
